# Contributor: Carlo Landmeter <clandmeter@alpinelinux.org>
# Maintainer: Carlo Landmeter <clandmeter@alpinelinux.org>
pkgname=ocrmypdf
pkgver=10.3.3
pkgrel=0
pkgdesc="Add OCR text layer to scanned PDF files"
url="https://github.com/jbarlow83/OCRmyPDF"
arch="noarch"
license="MIT"
options="!check" # failing tests with jbig2enc 0.17
depends="
	python3
	py3-setuptools
	py3-reportlab
	py3-chardet
	py3-cffi
	py3-img2pdf
	py3-pdfminer
	py3-pikepdf
	py3-pillow
	py3-tqdm

	tesseract-ocr
	ghostscript
	unpaper
	qpdf
	jbig2enc
	pngquant
	leptonica
	"
makedepends="python3-dev"
source="https://files.pythonhosted.org/packages/source/o/ocrmypdf/ocrmypdf-$pkgver.tar.gz"

build() {
	python3 setup.py build
}

check() {
	python3 setup.py test
}

package() {
	python3 setup.py install --prefix=/usr --root="$pkgdir"
}

sha512sums="7408dc595a9bd249a1bc17f85156f2336b69ac1fffbdadff72a735cdf72680b7169a055cd7a840ff21546b00931ce2a1f94995c82baa062259ec39b6cfd54b03  ocrmypdf-10.3.3.tar.gz"
